package com.sunshenshen.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunshenshen.bean.Student;
import com.sunshenshen.dao.StudentMapper;
import com.sunshenshen.service.StudentService;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {

	@Resource
	private StudentMapper studentMapper;
	
	@Override
	public PageInfo<Student> list(Student student, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		
		List<Student> list = studentMapper.list(student, pageNum, pageSize);
		
		PageInfo<Student> info = new PageInfo<Student>(list);
		return info;
	}

}
